package com.zhq.blog.core.domain.game.support;

import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;

import com.zhq.blog.core.domain.BaseRepository;

/**
 * @title:WinnerRecordRepository.java
 * @package com.zhq.blog.core.domain.game.support
 * @author 张恒强
 * @date 2015年1月9日 下午7:21:33
 * @version V1.0
 */
public interface WinnerRecordRepository extends JpaRepository<WinnerRecord, Long>,
					BaseRepository<WinnerRecord>,JpaSpecificationExecutor<WinnerRecord>{
	
	@Query("select wr from WinnerRecord wr where wr.gameId = :gameId and wr.period = :period order by wr.profit desc")
	Page<WinnerRecord> find_all_by_game_period(@Param("gameId")long gameId,@Param("period") long period,Pageable pageable);
	
}
